package top.lshaci.learning.jvm.gc;

/**
 * RefCountGC
 *
 * @author lshaci
 * @date 2020/7/29 14:59
 * @since 1.0.0
 */
public class RefCountGC {

    private byte[] bigSize = new byte[5 * 1024 * 1024];

    Object reference = null;

    /**
     * -XX:+PrintGCDetails
     */
    public static void main(String[] args) {
        RefCountGC ref1 = new RefCountGC();
        RefCountGC ref2 = new RefCountGC();

        ref1.reference = ref2;
        ref2.reference = ref1;

        ref1 = null;
        ref2 = null;

//        System.gc();
    }
}
